<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
     Yolin
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.png" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="Yolin" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content">
      
<section class="cover">
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/cover2.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">Yolin</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>

<div id="main">
  <section class="outer">
  <article class="articles">
    
    
    
    
    <article id="post-面向切面编程AOP" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/01/%E9%9D%A2%E5%90%91%E5%88%87%E9%9D%A2%E7%BC%96%E7%A8%8BAOP/"
    >面向切面编程AOP</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/01/%E9%9D%A2%E5%90%91%E5%88%87%E9%9D%A2%E7%BC%96%E7%A8%8BAOP/" class="article-date">
  <time datetime="2020-11-01T07:45:02.000Z" itemprop="datePublished">2020-11-01</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring%E6%A1%86%E6%9E%B6/">Spring框架</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、什么是AOP？"><a href="#一、什么是AOP？" class="headerlink" title="一、什么是AOP？"></a>一、什么是AOP？</h1><p><strong>AOP</strong>（Aspect Oriented Programming）<strong>面向切面编程</strong>，通过预编译方式和运行期动态代理实现程序功能的统一维护的一种技术。是面向对象的一种补充，用于将那些与业务无关，但却对多个对象产生影响的公共行为和逻辑，抽取并封装为一个可重用的模块，这个模块被称为“切面”（Aspect）</p>
<p>简单的说它就是<strong>把程序中重复的代码抽取出来，在需要执行的时候，使用动态代理的技术，在不修改源码的基础上，对我们的已有方法进行增强</strong></p>
<h1 id="二、名词解释"><a href="#二、名词解释" class="headerlink" title="二、名词解释"></a>二、名词解释</h1><ul>
<li><p><strong>横切关注点</strong>：与我们业务逻辑无关但需要关注的部分，如日志、事务、安全、缓存等</p>
</li>
<li><p><strong>切面</strong>（Aspect）：横切关注点被模块化的特殊对象，即它是一个类（日志类log）</p>
</li>
<li><p><strong>通知</strong>（Advice）：切面必须完成的工作。即它是类的一个方法（Log中的方法）</p>
<blockquote>
<ul>
<li>前置通知（before）  目标方法被调用之前调用通知功能</li>
<li>后置通知(after)     在目标方法完成之后调用通知此时不会关心方法输出什么</li>
<li>后置返回通知(after returing)    目标方法成功执行后调用通知</li>
<li>异常通知(after throwing)    在目标方法抛出异常后调用通知</li>
<li>环绕通知(around)    通知包裹了被通知的方法，在被通知的方法调用之前和调用之后执行自定义行为</li>
</ul>
</blockquote>
</li>
<li><p><strong>目标</strong>（Target）：被通知对象（接口）</p>
</li>
<li><p><strong>代理</strong>（Proxy）：想目标对象应用通知后创建的对象（生成的代理类）</p>
</li>
<li><p><strong>切入点</strong>（PointCut）：切面通知执行的“地点”的定义</p>
</li>
<li><p><strong>连接点</strong>（JointPoint）:与切入点匹配的执行点</p>
</li>
<li><p><strong>织入</strong>（Weaving）：织入是把切面应用到目标对象并创建新的代理对象的过程。</p>
</li>
</ul>
      
      <a class="article-more-link" href="/2020/11/01/%E9%9D%A2%E5%90%91%E5%88%87%E9%9D%A2%E7%BC%96%E7%A8%8BAOP/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/AOP/" rel="tag">AOP</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86/" rel="tag">动态代理</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-代理模式" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/10/29/%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F/"
    >代理模式</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/10/29/%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F/" class="article-date">
  <time datetime="2020-10-29T07:45:02.000Z" itemprop="datePublished">2020-10-29</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/">设计模式</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="1-何为代理模式"><a href="#1-何为代理模式" class="headerlink" title="1.何为代理模式"></a>1.何为代理模式</h2><p><strong>目的</strong>：为其他对象提供一种代理以控制这个对象的访问</p>
<p><strong>何时使用</strong>：想在访问一个类时做一些控制</p>
<p><strong>解决方案</strong>：增加中间层</p>
<p><strong>优点</strong>：高扩展性、清晰</p>
<p><strong>缺点</strong>：实现代理模式需要额外的工作，可能会造成请求的处理速度变慢</p>
<pre><code>SpringAOP的底层就是代理模式</code></pre><p><strong>代理模式的分类</strong>：</p>
<blockquote>
<p>  <strong>静态代理</strong><br>  <strong>动态代理</strong></p>
</blockquote>
<h2 id="2-静态代理"><a href="#2-静态代理" class="headerlink" title="2.静态代理"></a>2.静态代理</h2><p>举一个生活中租房子的例子</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-10-25_13-08-48.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/10/29/%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86/" rel="tag">动态代理</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9D%99%E6%80%81%E4%BB%A3%E7%90%86/" rel="tag">静态代理</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Spring框架的使用（二）" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/10/24/Spring%E6%A1%86%E6%9E%B6%E7%9A%84%E4%BD%BF%E7%94%A8%EF%BC%88%E4%BA%8C%EF%BC%89/"
    >Spring框架的使用（二）</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/10/24/Spring%E6%A1%86%E6%9E%B6%E7%9A%84%E4%BD%BF%E7%94%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" class="article-date">
  <time datetime="2020-10-24T13:45:02.000Z" itemprop="datePublished">2020-10-24</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring%E6%A1%86%E6%9E%B6/">Spring框架</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、Bean的自动装配"><a href="#一、Bean的自动装配" class="headerlink" title="一、Bean的自动装配"></a>一、Bean的自动装配</h2><ul>
<li><strong>自动装配</strong>是Spring满足bean依赖的一种方式</li>
<li>Spring会在上下文中自动寻找，并自动给bena装配属性</li>
</ul>
<p>在Spring中有三种装配方式</p>
<ol>
<li><strong>在xml中显式的配置</strong></li>
<li><strong>在java中显式的配置</strong></li>
<li><strong>隐式的自动装配bean（重要）</strong></li>
</ol>
<h3 id="1-显示装配环境搭建"><a href="#1-显示装配环境搭建" class="headerlink" title="1.显示装配环境搭建"></a>1.显示装配环境搭建</h3><p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-10-22_14-25-46.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/10/24/Spring%E6%A1%86%E6%9E%B6%E7%9A%84%E4%BD%BF%E7%94%A8%EF%BC%88%E4%BA%8C%EF%BC%89/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Spring%E6%A1%86%E6%9E%B6/" rel="tag">Spring框架</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%B3%A8%E8%A7%A3%E5%BC%80%E5%8F%91/" rel="tag">注解开发</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%87%AA%E5%8A%A8%E8%A3%85%E9%85%8D/" rel="tag">自动装配</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Spring框架的使用（一）" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/10/19/Spring%E6%A1%86%E6%9E%B6%E7%9A%84%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/"
    >Spring框架的使用（一）</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/10/19/Spring%E6%A1%86%E6%9E%B6%E7%9A%84%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/" class="article-date">
  <time datetime="2020-10-19T14:45:02.000Z" itemprop="datePublished">2020-10-19</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring%E6%A1%86%E6%9E%B6/">Spring框架</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、Spring"><a href="#一、Spring" class="headerlink" title="一、Spring"></a>一、Spring</h1><h2 id="聊一聊Spring"><a href="#聊一聊Spring" class="headerlink" title="聊一聊Spring"></a>聊一聊Spring</h2><p><strong>Spring是一个轻量级Java开发框架，目的是为了解决企业级应用开发的业务逻辑和其他各层的耦合。Spring可以做很多事，为企业级开发提供丰富的功能，其底层都依赖于两个特性：</strong></p>
<blockquote>
<p>  <strong>依赖注入（DI）</strong></p>
<p>  <strong>面向切面编程（AOP）</strong></p>
</blockquote>
<p>可简单理解为：</p>
<pre><code>Spring就是一个轻量级的控制反转(IOC)和面向切面编程(AOP)的框架</code></pre><h2 id="设计理念与优缺点"><a href="#设计理念与优缺点" class="headerlink" title="设计理念与优缺点"></a>设计理念与优缺点</h2><h3 id="1-设计理念"><a href="#1-设计理念" class="headerlink" title="1.设计理念"></a>1.设计理念</h3><p>通过<strong>Ioc容器</strong>管理POJO对象以及他们之间的耦合关系，通过AOP以<a href="#">动态非侵入</a>的方式增强服务。</p>
<ul>
<li><strong>动态非入侵</strong>：使用spring编写业务类时不需要继承spring特定的类，通过配置完成依赖注入后就可以使用，此时，spring就没有侵入到业务代码里。</li>
</ul>
<h3 id="2-优点"><a href="#2-优点" class="headerlink" title="2.优点"></a>2.优点</h3><ul>
<li>① <strong>方便解耦，简化开发</strong>。可将所有对象的创建和依赖关系交给Spring管理</li>
<li>② <strong>支持面向切面编程（AOP）</strong>，可方便的实现对程序进行权限拦截、运行监控等功能</li>
<li>③ <strong>方便集成各种框架</strong></li>
<li>④ <strong>方便接口调用</strong>。Spring对一些API如JDBC、提供了封装，方便调用</li>
</ul>
<h3 id="3-缺点"><a href="#3-缺点" class="headerlink" title="3.缺点"></a>3.缺点</h3><p>Spring依赖，<strong>反射</strong>影响性能</p>
      
      <a class="article-more-link" href="/2020/10/19/Spring%E6%A1%86%E6%9E%B6%E7%9A%84%E4%BD%BF%E7%94%A8%EF%BC%88%E4%B8%80%EF%BC%89/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/DI/" rel="tag">DI</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/IoC/" rel="tag">IoC</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Spring%E6%A1%86%E6%9E%B6/" rel="tag">Spring框架</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-框架入门-第一个Mybatis程序" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/10/01/%E6%A1%86%E6%9E%B6%E5%85%A5%E9%97%A8-%E7%AC%AC%E4%B8%80%E4%B8%AAMybatis%E7%A8%8B%E5%BA%8F/"
    >框架入门_第一个Mybatis程序</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/10/01/%E6%A1%86%E6%9E%B6%E5%85%A5%E9%97%A8-%E7%AC%AC%E4%B8%80%E4%B8%AAMybatis%E7%A8%8B%E5%BA%8F/" class="article-date">
  <time datetime="2020-10-01T15:45:02.000Z" itemprop="datePublished">2020-10-01</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/MyBatis/">MyBatis</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、框架概述"><a href="#一、框架概述" class="headerlink" title="一、框架概述"></a>一、框架概述</h1><h2 id="1-1-什么是框架？"><a href="#1-1-什么是框架？" class="headerlink" title="1.1 什么是框架？"></a>1.1 什么是框架？</h2><p><strong>框架</strong>(Framework)是整个或部分系统的可重用设计，表现为一组抽象构件及构件实例间交互的方法；</p>
<p>简而言之，框架其实就是某种应用的半成品，就是一组组件，供你选用完成自己的系统。可理解为使用别人搭建好的舞台，你来做表演。</p>
<p>框架要解决的问题：<strong>框架封装了很多的细节，使开发者可以使用极简的方式实现功能，大大提高开发效率</strong></p>
<h2 id="1-2-三层架构"><a href="#1-2-三层架构" class="headerlink" title="1.2 三层架构"></a>1.2 三层架构</h2><ul>
<li>三层架构主要是指将业务应用规划中的表示层 UI、数据访问层 DAL 以及业务逻辑层 BLL，其分层的核心任务是“高内聚低耦合，可以降低层与层之间的依赖”。</li>
<li>各层互相独立，完成自己该完成的任务，项目可以多人同时开发，开发人员可以只关注整个结构中的其中某一层。</li>
</ul>
<pre><code>表现层： 
     用于展示数据
业务层
     处理业务需求
持久层
     和数据交互的</code></pre>
      
      <a class="article-more-link" href="/2020/10/01/%E6%A1%86%E6%9E%B6%E5%85%A5%E9%97%A8-%E7%AC%AC%E4%B8%80%E4%B8%AAMybatis%E7%A8%8B%E5%BA%8F/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mybatis/" rel="tag">Mybatis</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SSM%E6%A1%86%E6%9E%B6/" rel="tag">SSM框架</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Response对象" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/09/29/Response%E5%AF%B9%E8%B1%A1/"
    >Response对象</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/09/29/Response%E5%AF%B9%E8%B1%A1/" class="article-date">
  <time datetime="2020-09-29T15:45:02.000Z" itemprop="datePublished">2020-09-29</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-Web/">Java Web</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、Http协议：响应消息"><a href="#一、Http协议：响应消息" class="headerlink" title="一、Http协议：响应消息"></a>一、Http协议：响应消息</h1><ul>
<li>响应消息：服务器端发送给客户端的数据</li>
</ul>
<h2 id="数据格式"><a href="#数据格式" class="headerlink" title="数据格式"></a>数据格式</h2><h3 id="响应行"><a href="#响应行" class="headerlink" title="响应行"></a>响应行</h3><blockquote>
<ol>
<li>组成：协议、版本、响应状态码、 状态码描述</li>
<li>响应状态码：服务器告诉客户端浏览器本次请求和响应的一个状态<br>  ① <strong>1xx</strong>：服务器接收客户端消息，但没有接收完成，等待一段时间后，发送1xx状态码<br>  ② <strong>2xx</strong>：成功处理请求。代表：200<br>  ③ <strong>3xx</strong>：重定向。代表：302(重定向)，304(访问缓存)<br>  ④ <strong>4xx</strong>：客户端错误。代表：404(请求路径没有对应的资源)，405：请求方式没有对应的doXXX方法<br>  ⑤ <strong>5xx</strong>：服务器端错误。代表：500(服务器内部出现异常)</li>
</ol>
</blockquote>
<h3 id="响应头"><a href="#响应头" class="headerlink" title="响应头"></a>响应头</h3><blockquote>
<ol>
<li>格式：头名称：值</li>
<li>常见的响应头：<br>① <strong>Content-Type</strong>:服务器告诉客户端本次响应体数据格式以及编码格式<br>② <strong>Content-disposition</strong>:服务器告诉客户端以什么格式打开响应体数据<pre><code>值：
    * in-line:默认值，在当前页面内打开
    * attachment;filename=xxx:以附件形式打开响应体。文件下载时使用</code></pre></li>
</ol>
</blockquote>
<h3 id="响应体"><a href="#响应体" class="headerlink" title="响应体"></a>响应体</h3><ul>
<li>即传输的数据
      
      <a class="article-more-link" href="/2020/09/29/Response%E5%AF%B9%E8%B1%A1/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Http%E5%93%8D%E5%BA%94%E6%B6%88%E6%81%AF/" rel="tag">Http响应消息</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Response/" rel="tag">Response</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BD%BD/" rel="tag">文件下载</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%AA%8C%E8%AF%81%E7%A0%81/" rel="tag">验证码</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Request对象" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/09/26/Request%E5%AF%B9%E8%B1%A1/"
    >Request对象</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/09/26/Request%E5%AF%B9%E8%B1%A1/" class="article-date">
  <time datetime="2020-09-26T15:45:02.000Z" itemprop="datePublished">2020-09-26</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-Web/">Java Web</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="request对象与response对象的原理"><a href="#request对象与response对象的原理" class="headerlink" title="request对象与response对象的原理"></a>request对象与response对象的原理</h2><ol>
<li>request和response对象是由服务器创建的</li>
<li>request对象是来获取请求消息，response对象是来设置响应消息</li>
</ol>
<h3 id="请求响应的具体实现"><a href="#请求响应的具体实现" class="headerlink" title="请求响应的具体实现"></a>请求响应的具体实现</h3><p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-09-21_20-58-46.jpg" alt=""></p>
<h2 id="Request"><a href="#Request" class="headerlink" title="Request"></a>Request</h2><h3 id="request对象继承体系结构"><a href="#request对象继承体系结构" class="headerlink" title="request对象继承体系结构"></a>request对象继承体系结构</h3><pre><code>ServletRequest       -- 接口
      |   继承
HttpServletRequest    --接口
      |   实现
org.apache.catalina.connector.RequestFacade  --tomcat提供的类</code></pre>
      
      <a class="article-more-link" href="/2020/09/26/Request%E5%AF%B9%E8%B1%A1/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Request/" rel="tag">Request</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Servlet/" rel="tag">Servlet</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E7%99%BB%E5%BD%95%E6%A1%88%E4%BE%8B/" rel="tag">登录案例</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Servlet概述" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/09/21/Servlet%E6%A6%82%E8%BF%B0/"
    >Servlet概述</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/09/21/Servlet%E6%A6%82%E8%BF%B0/" class="article-date">
  <time datetime="2020-09-21T15:45:02.000Z" itemprop="datePublished">2020-09-21</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-Web/">Java Web</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="Servlet-Server-applet"><a href="#Servlet-Server-applet" class="headerlink" title="Servlet(Server applet)"></a>Servlet(Server applet)</h1><h2 id="概念"><a href="#概念" class="headerlink" title="概念"></a>概念</h2><p>运行在web服务器端的程序，它是作为来自web浏览器或其他HTTP客户端的请求和HTTP服务器上的数据库或应用程序之间的中间层Servlet就是一个接口，定义了Java类被浏览器访问到(tomcat识别)的规则</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-09-21_12-25-46.jpg" alt=""></p>
<p><a href="https://www.runoob.com/servlet/servlet-intro.html" target="_blank" rel="noopener">更多内容</a></p>
<h2 id="入门"><a href="#入门" class="headerlink" title="入门"></a>入门</h2><ol>
<li>创建JavaEE项目</li>
<li>定义一个类，实现Servlet接口</li>
<li>实现接口中的抽象方法</li>
<li>配置Servlet</li>
</ol>
      
      <a class="article-more-link" href="/2020/09/21/Servlet%E6%A6%82%E8%BF%B0/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/HttpServlet/" rel="tag">HttpServlet</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Servlet/" rel="tag">Servlet</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Spring-JDBC" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/09/17/Spring-JDBC/"
    >Spring JDBC</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/09/17/Spring-JDBC/" class="article-date">
  <time datetime="2020-09-17T10:45:02.000Z" itemprop="datePublished">2020-09-17</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-Web/">Java Web</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="Spring-JDBC"><a href="#Spring-JDBC" class="headerlink" title="Spring JDBC"></a>Spring JDBC</h2><p>Spring JDBC是<strong>Spring框架对JDBC的简单封装。提供了一个JDBCTemplate对象简化JDBC的开发</strong></p>
<p>Spring的JDBC模块负责数据库资源管理和错误处理，大大简化了开发人员对数据库的操作，使开发人员从繁琐的数据库操作中解脱，从而将更多精力投入到编写业务逻辑中</p>
<h2 id="JdbcTemplate解析"><a href="#JdbcTemplate解析" class="headerlink" title="JdbcTemplate解析"></a>JdbcTemplate解析</h2><p>针对数据库的操作，Spring框架提供了JdbcTemplate类，该类是Spring框架数据抽象层的基础。可以说，JdbcTemplate类是Spring JDBC的核心类</p>
<p>JdbcTemplate类的直接父类是JdbcAccessor,该类为子类提供了一些访问数据库时使用的公共属性</p>
<p><strong>DataSource</strong>：其主要功能是获取数据库连接，还可以引入对数据库连接的缓冲池和分布式事务的支持，它可以作为访问数据库资源的标准接口。</p>
<p><a href="https://blog.csdn.net/weixin_44117272/article/details/94716724" target="_blank" rel="noopener">参考资料</a></p>
      
      <a class="article-more-link" href="/2020/09/17/Spring-JDBC/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Spring-JDBC/" rel="tag">Spring JDBC</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-数据库连接池" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/09/15/%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E6%B1%A0/"
    >数据库连接池</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/09/15/%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E6%B1%A0/" class="article-date">
  <time datetime="2020-09-15T08:45:02.000Z" itemprop="datePublished">2020-09-15</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java-Web/">Java Web</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="数据库连接池基础"><a href="#数据库连接池基础" class="headerlink" title="数据库连接池基础"></a>数据库连接池基础</h1><p>其实就是一个容器(集合)，存放数据库连接的容器。</p>
<p>当系统初始化好后，容器被创建，容器中会申请一些连接对象，当用户来访问数据库时，从容器中获取连接对象，用户访问完之后，会将连接对象归还给容器。</p>
<h2 id="好处"><a href="#好处" class="headerlink" title="好处"></a>好处</h2><ol>
<li>节约资源</li>
<li>用户访问高效</li>
</ol>
<h2 id="实现"><a href="#实现" class="headerlink" title="实现"></a>实现</h2><blockquote>
<p>标准接口：DataSource  javax.sql包下</p>
</blockquote>
<p>方法：</p>
<ul>
<li>获取连接：getConnection()</li>
</ul>
      
      <a class="article-more-link" href="/2020/09/15/%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E6%B1%A0/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E6%B1%A0/" rel="tag">数据库连接池</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
  </article>
  

  
  <nav class="page-nav">
    
    <a class="extend prev" rel="prev" href="/page/2/">上一页</a><a class="page-number" href="/">1</a><a class="page-number" href="/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><span class="space">&hellip;</span><a class="page-number" href="/page/10/">10</a><a class="extend next" rel="next" href="/page/4/">下一页</a>
  </nav>
  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2020-2021
        张金
      </li>
      <li>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
        <img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/beian.png">
        <a href="https://beian.miit.gov.cn"  style="color:#f72b07" target="_blank">陕ICP备20002449号</a>
      </li>

    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="Yolin"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/playlist">歌单</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/video">视频</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于我</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友情链接</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['肠断月明红豆蔻,','月似当时,','人似当时否？'],
    startDelay: 1500,
    typeSpeed: 200,
    loop: true,
    backSpeed: 40,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script>
  var ayerConfig = {
    mathjax: true
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>



<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>